package EX1;
//新建一个学生类
class Student{
    //学生类属性
    private int sid;
    private int age;
    private int banji;
    private String name;
    private String gender;
    private String character;
    //获得学号
    public void setSid(int sid){
        this.sid=sid;
    }
    //获得姓名
    public void setName(String name){
        this.name=name;
    }
    //获得年龄
    public void setAge(int age){
        this.age=age;
    }
    //获得班级
    public void setBanji(int banji){
        this.banji=banji;
    }
    //获得性别
    public void setGender(String gender){
        this.gender=gender;
    }
    //获得性格
    public void setCharacter(String character){
        this.character=character;
    }
    //信息概要
    public void say(){
        System.out.println("My name is "+name+".My id is "+sid+".I am "+age+" years old.I am from class "+banji+".I am a "+character+" "+gender+".");
    }
};

public class Exercise1 {
    public static void main(String[] args){
        //创建三个Student类对象
        Student stu1=new Student();
        Student stu2=new Student();
        Student stu3=new Student();
        stu1.setSid(1001);
        stu1.setName("Frank");
        stu1.setAge(17);
        stu1.setBanji(1);
        stu1.setGender("boy");
        stu1.setCharacter("outgoing");
        stu2.setSid(1002);
        stu2.setName("Jenny");
        stu2.setAge(18);
        stu2.setBanji(2);
        stu2.setGender("girl");
        stu2.setCharacter("optimistic");
        stu3.setSid(1003);
        stu3.setName("Tom");
        stu3.setAge(16);
        stu3.setBanji(3);
        stu3.setGender("boy");
        stu3.setCharacter("energetic");
        stu1.say();
        stu2.say();
        stu3.say();
    }
}
